<?php
header("Content-type: text/html; charset=utf-8");
require("inc/common.inc.php");
$nowdate=date("Y-m-d");
$adate=date('Y-m-d',strtotime("$nowdate -7 day"));
$id=intval($id);
if ($id>0){
	$fidinfo=$db->getinfo("select * from mx_vpp_articleclass where fid='$id' limit 1");
	if (!is_array($fidinfo)){
		echo "|@#page#@|";
		exit();
	}
}
$pagesize=intval($pagesize);
if ($pagesize==0){$pagesize=2;}

	if(empty($pageindex)){$pageindex=1;}
    $str=" and yz='1' ";
    $s="";
	if ($id>0){
		$idstr=$id.$db->get_aid($id,"mx_vpp_articleclass");
		$str.=" and fid in ($idstr) ";
		$s.="id=$id&";
	}
	

	$table=" mx_vpp_article ";
	$order=" order by orderid asc,isgood desc,istop desc, posttime desc, aid desc";
	$column=" * ";
	$biaoid="aid";

	$c=$db->listcount($table,$str);

	$list=$db->list1($pageindex,$pagesize,$table,$column,$str,$order,$biaoid);

	if(!is_array($list) or $c==0 and $pageindex==1){
	  echo "|@#page#@|";
	  exit();
	}
	else{
	$nowhavenum=($pagesize*($pageindex-1))+count($list);
	if ($nowhavenum<$c){echo "1";}
	echo "|@#page#@|";
	for($i=0;$i<count($list);$i++){
	?>
	
	
	<li>
		<a href="articleshow.php?id=<?php echo $list[$i][aid]?>&fromwxopenid=<?php echo $wxmxopenid;?>"><?php if (trim($list[$i]["picurl"])!=""){?><img src="<?php echo get_photourl($list[$i]["picurl"]);?>" width="120" height="120"><?php }?></a>
			<p class="ellipsis"><a href="articleshow.php?id=<?php echo $list[$i][aid]?>&fromwxopenid=<?php echo $wxmxopenid;?>" title="<?php echo $list[$i]["title"]?>"><?php echo wordscut($list[$i]["title"],18)?></a></p>
				<del>市场价￥<?php echo $list[$i]["price"]?></del>
					<p>会员价<span>￥<?php echo $list[$i]["vipprice"]?></span></p>
	</li>
<?php
	}
	}
?>